import React from 'react';
import UserInfo from './userInfo';

/**
 * 评论组件
 * @param {*} props 
 * @returns 
 */
export default function Comment(props) {
    return (
        <div className="Comment">
          <UserInfo user={props.user} />
          <div className="Comment-text">
            {props.text}
          </div>
          <div className="Comment-date">
            {formatDate(props.date)}
          </div>
        </div>
    );
}

// 防止报错，新建的函数，需要重写
function formatDate(date) {
    return date;
}
